//
//  SignupCompleteController.m
//  SmallElephant
//
//  Created by Faith on 2024/11/11.
//

#import "SignupCompleteController.h"

@interface SignupCompleteController ()

@end

@implementation SignupCompleteController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view applyStyle:@"background: #FFFFFF;"];
    [self setTitleText:@"填写资料"];
    
    // 昵称输入框
    UILabel *nicknameTitleView = [[UILabel alloc] init];
    nicknameTitleView.text = @"昵称";
    [self.view addSubview:nicknameTitleView style:@"display: flex; font-size:16px; color: #333333; margin-left: 20px; align-items: center; margin-top: 20px; margin-right: 20px;"];
    
    UIView *nicknameView = [[UIView alloc] init];
    [self.view addSubview:nicknameView style:@"display: flex; flex-direction: row; margin-left: 20px; align-items: center; margin-top: 10px; margin-right: 20px; background: #F6F6F6; border-radius: 22px; height: 44px;"];
    UITextField *phoneInputView = [[UITextField alloc] init];
    phoneInputView.placeholder = @"请输入昵称，例如：张三";
    [nicknameView addSubview:phoneInputView style:@"display: flex; flex:1; color: #666666; font-size: 14px; margin-left: 15px; margin-right: 15px;"];
    
    // 密码输入框
    UILabel *passwordTitleView = [[UILabel alloc] init];
    passwordTitleView.text = @"设置密码";
    [self.view addSubview:passwordTitleView style:@"display: flex; font-size:16px; color: #333333; margin-left: 20px; align-items: center; margin-top: 20px; margin-right: 20px;"];
    
    UIView *passwordView = [[UIView alloc] init];
    [self.view addSubview:passwordView style:@"display: flex; flex-direction: row; margin-left: 20px; align-items: center; margin-top: 10px; margin-right: 20px; background: #F6F6F6; border-radius: 22px; height: 44px;"];
    UITextField *passwordInputView = [[UITextField alloc] init];
    passwordInputView.placeholder = @"请设置6-20位密码";
    [passwordView addSubview:passwordInputView style:@"display: flex; flex:1; color: #666666; font-size: 14px; margin-left: 15px; margin-right: 15px;"];

    
    // 确认密码输入框
    UILabel *confirmPasswordTitleView = [[UILabel alloc] init];
    confirmPasswordTitleView.text = @"确认密码";
    [self.view addSubview:confirmPasswordTitleView style:@"display: flex; font-size:16px; color: #333333; margin-left: 20px; align-items: center; margin-top: 20px; margin-right: 20px;"];
    
    UIView *confirmPasswordView = [[UIView alloc] init];
    [self.view addSubview:confirmPasswordView style:@"display: flex; flex-direction: row; margin-left: 20px; align-items: center; margin-top: 10px; margin-right: 20px; background: #F6F6F6; border-radius: 22px; height: 44px;"];
    UITextField *confirmPasswordInputView = [[UITextField alloc] init];
    confirmPasswordInputView.placeholder = @"请再次输入6-20位密码";
    [confirmPasswordView addSubview:confirmPasswordInputView style:@"display: flex; flex:1; color: #666666; font-size: 14px; margin-left: 15px; margin-right: 15px;"];

    UILabel *confirmPasswordTip = [[UILabel alloc] init];
    confirmPasswordTip.numberOfLines = 0;
    confirmPasswordTip.text = @"密码必须是6-20个英文字母、数字或符号(除空格)，且字母、数字和标点符号至少包含两种。";
    [self.view addSubview:confirmPasswordTip style:@"display: flex; font-size:12px; color: #858383; margin-left: 20px; align-items: center; margin-top: 10px; margin-right: 20px;"];
    
    // 完成注册按钮
    UIButton * btnSendCaptcha = [UIButton buttonWithType:UIButtonTypeCustom];
    [btnSendCaptcha setTitle:@"完成注册" forState:UIControlStateNormal];
    [btnSendCaptcha setBackgroundColor:[UIColor colorWithHexString:@"#EF2020"]];
    [btnSendCaptcha addTarget:self action:@selector(btnAgreeClickEventHandler:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btnSendCaptcha style:@"display: flex; height:44px; border-radius: 5px; margin-left: 20px; font-size: 16px; margin-top: 40px; margin-right: 20px;"];

}

/// 复选框点击事件
- (void)btnAgreeClickEventHandler:(UIButton*)button {
    button.selected = !button.selected;
}

@end
